package com.cheejee.goodscenter.module.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.cheejee.goodscenter.validated.InsertGroup;
import com.cheejee.goodscenter.validated.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public class CategoryPropertiesGroup {

	@NotNull(message = "分类属性分组id不能为空", groups = UpdateGroup.class)
	private Integer id;

	@NotNull(message = "分类id不能为空", groups = { InsertGroup.class, UpdateGroup.class })
	private Integer categoryId;

	@NotBlank(message = "分类属性分组名称不能为空", groups = { InsertGroup.class, UpdateGroup.class })
	@Length(max = 200, message = "分类属性名称长度不能超过200字", groups = { InsertGroup.class, UpdateGroup.class })
	private String groupName;

	private String describe;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName == null ? null : groupName.trim();
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe == null ? null : describe.trim();
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", categoryId=").append(categoryId);
		sb.append(", groupName=").append(groupName);
		sb.append(", describe=").append(describe);
		sb.append("]");
		return sb.toString();
	}
}